package com.xuexiang.xui_lib;

import ohos.aafwk.ability.AbilityPackage;

public class XUI {
    private static AbilityPackage sContext;

    //=======================初始化设置===========================//

    /**
     * 初始化
     *
     * @param context 上下文
     */
    public static void init(AbilityPackage context) {
        sContext = context;
    }

    public static AbilityPackage getContext() {
        testInitialize();
        return sContext;
    }

    private static void testInitialize() {
        if (sContext == null) {
            throw new ExceptionInInitializerError("请先在全局Application中调用 XUI.init() 初始化！");
        }
    }

}
